/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 洪汤泽大帅哥
 * Date: 2024-10-16
 * Time: 20:45
 */
import java.util.Scanner;

class Vehicle {//根据要求完成类的设计
    public int length;
    public String plateNo;

    Vehicle(){

    }

    Vehicle(int length,String plateNo){
        this.length=length;
        this.plateNo=plateNo;
    }

    public String getString(){
        return "车牌号："+plateNo+"\n车长："+length;
    }
}
class Bus extends Vehicle{//根据要求完成类的设计
    private int passenger;
    Bus(int length,String plateNo,int passenger){
        super(length,plateNo);
        this.passenger = passenger;
    }

    @Override
    public String getString() {
        return super.getString()+"\n核定载人数："+this.passenger;
    }
    public double getRate() {
        if(super.length<6000 && this.passenger<=9) {
            return 0.6;
        }
        else if(super.length<6000 && this.passenger >= 10 && this.passenger <= 19) {
            return 0.6;
        }
        else if(super.length >= 6000 && this.passenger >= 20 && this.passenger <= 39) {
            return 0.9;
        }
        else if(super.length >= 6000 && this.passenger >=40) {
            return 0.9;
        }
        return -1;
    }
}
class Truck extends Vehicle{//根据要求完成类的设计
    private double weight;
    private int numbersOfAxles;
    Truck(int length,String plateNo,double weight,int numbersOfAxles) {
        super(length,plateNo);
        this.numbersOfAxles=numbersOfAxles;
        this.weight=weight;
    }

    @Override
    public String getString() {
        return super.getString()+"\n最大允许总重量："+weight+"\n车轴数:"+numbersOfAxles;
    }
    public double getRate() {
        if(numbersOfAxles==2 && length<6000 && weight<4500) {
            return 0.6;
        }
        else if(numbersOfAxles==2 && length>=6000 && weight>=4500) {
            return 0.9;
        }
        else if(numbersOfAxles==3) {
            return 1.02;
        }
        else if(numbersOfAxles==4) {
            return 1.315;
        }
        else if(numbersOfAxles==5) {
            return 1.428;
        }
        else if(numbersOfAxles==6) {
            return 1.428;
        }
        return -1;
    }



}

            public class Main {

                public static void main(String[] args) {
                    // TODO Auto-generated method stub
                    Scanner input = new Scanner(System.in);
                    double distance = 170;//设定该高速公路长度
                    int flag = input.nextInt();
                    if (flag == 1) {
                        Bus bus = new Bus(input.nextInt(), input.next(), input.nextInt());
                        System.out.println("***客车信息***");
                        System.out.println(bus.getString());
                        double fees = distance * bus.getRate();
                        System.out.println("您的车辆需缴费" + fees + "元！");
                    } else if (flag == 2) {
                        Truck truck = new Truck(input.nextInt(), input.next(), input.nextDouble(), input.nextInt());
                        System.out.println("***货车信息***");
                        System.out.println("货车：" + truck.getString());
                        double fees = distance * truck.getRate();
                        System.out.println("您的车辆需缴费" + fees + "元！");
                    } else
                        System.out.println("已退出收费系统！");
                    input.close();
                }

            }


/* 请在这里填写答案 */